//
//  CategoryViewController.m
//  UI_HLJ_Frame
//
//  Created by  毕宏伟 on 15/6/29.
//  Copyright (c) 2015年 毕宏伟. All rights reserved.
//

#import "CategoryViewController.h"
#import "PackageViewController.h"
#import "PackageModel.h"
#import "PackageCell.h"

#import "UIImageView+WebCache.h"
#define WIDTH self.view.frame.size.width
#define HEIGHT self.view.frame.size.height

@interface CategoryViewController ()

@property(nonatomic, retain)UITableView *tableView;
// 用来装套餐model的数组
@property(nonatomic, retain)NSMutableArray *tableViewArr;

// 毛玻璃
//@property(nonatomic, retain)UIVisualEffectView *effectView;



@end

@implementation CategoryViewController

- (void)dealloc
{
    [_tableView release];
    [_tableViewArr release];
    
    [super dealloc];
}



- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    // 搜索栏
//    UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(70, 20, WIDTH-100, 0)];
//    searchBar.placeholder = @"请输入套餐、商家、案例、商品";
//    
//    [self.navigationController.navigationBar addSubview:searchBar];
    
    self.navigationController.navigationBar.translucent=NO;
    
    self.title = @"分类";
    
    // 背景图片
    UIImage *image = [UIImage imageNamed:@"fenleiViewNew.jpg"];
    UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
    imageView.frame = CGRectMake(0, 0, WIDTH ,HEIGHT-64-49);
    [self.view addSubview:imageView];
    [imageView release];
    

//#pragma mark 毛玻璃
//    UIBlurEffect *efffect = [UIBlurEffect effectWithStyle:0];
//    self.effectView = [[UIVisualEffectView alloc] initWithEffect:efffect];
//    self.effectView.frame = CGRectMake(0, 0, imageView.frame.size.width, imageView.frame.size.height + 2);
//    self.effectView.alpha = 0.4;
//    [imageView addSubview:self.effectView];
//    [self.effectView release];

    
    
    self.view.frame = CGRectMake(0, 0, WIDTH, HEIGHT);
    self.view.backgroundColor = [UIColor whiteColor];
    DCPathButton *dcPathButton = [[DCPathButton alloc]
                                  // 周围button数量
                                  initDCPathButtonWithSubButtons:6
                                  // 动画中心点到周围图标中心点
                                  totalRadius:100
                                  // 中心动画的大小
                                  centerRadius:40
                                  // 周围动画的大小
                                  subRadius:35
                                  centerImage:@"fenleiView.png"
                                  centerBackground:nil
                                  subImages:^(DCPathButton *dc){
                                      // 婚礼策划
                                      [dc subButtonImage:@"婚礼策划2" withTag:0];
                                      // 婚纱摄影
                                      [dc subButtonImage:@"婚纱摄影2" withTag:1];
                                      // 摄影师
                                      [dc subButtonImage:@"摄影师2" withTag:2];
                                      // 摄像师
                                      [dc subButtonImage:@"摄像师2" withTag:3];
                                      // 化妆师
                                      [dc subButtonImage:@"化妆师2" withTag:4];
                                      // 主持人
                                      [dc subButtonImage:@"主持人2" withTag:5];
                                  }
                                  subImageBackground:nil
                                  inLocationX:0 locationY:0 toParentView:self.view];
    dcPathButton.delegate = self;
}





#pragma mark - DCPathButton delegate

- (void)button_0_action{
    NSLog(@"Button Press Tag 0!!");

    PackageViewController *packageView = [[PackageViewController alloc] init];
    
    packageView.packageStr = @"http://hunliji.com/v2/api/app/works";
    packageView.packageDic = @{@"page": @"1",@"per_page":@"20", @"commodity_type":@"0", @"first_query_time":@"2015-06-25T07%3A53%3A41Z", @"property":@"2",@"sort[key]":@"default",@"sort[order]":@"desc"};
    
    packageView.caseStr = @"http://hunliji.com/v2/api/app/works";
    packageView.caseDic = @{@"page": @"1",@"per_page":@"20", @"commodity_type":@"1", @"first_query_time":@"2015-06-25T08%3A07%3A43Z", @"property":@"2",@"sort[key]":@"default",@"sort[order]":@"desc"};
    
    packageView.merchantStr = @"http://www.hunliji.com/v1/api/app/merchants.json";
    packageView.merchantDic = @{@"per_page":@"20",@"property":@"2", @"sort":@"default",@"page":@"1"};
    

    [self.navigationController pushViewController:packageView animated:YES];
}

- (void)button_1_action{
    NSLog(@"Button Press Tag 1!!");
    
    PackageViewController *packageView = [[PackageViewController alloc] init];
    
    packageView.packageStr = @"http://hunliji.com/v2/api/app/works";
    packageView.packageDic = @{@"page": @"1",@"per_page":@"20", @"commodity_type":@"0", @"first_query_time":@"2015-06-25T08%3A22%3A45Z", @"property":@"6",@"sort[key]":@"default",@"sort[order]":@"desc"};
    
    packageView.caseStr = @"http://hunliji.com/v2/api/app/works";
    packageView.caseDic = @{@"page": @"1",@"per_page":@"20", @"commodity_type":@"1", @"first_query_time":@"2015-06-25T08%3A26%3A37Z", @"property":@"6",@"sort[key]":@"default",@"sort[order]":@"desc"};
    
    packageView.merchantStr = @"http://hunliji.com/v1/api/app/merchants.json";
    packageView.merchantDic = @{@"per_page":@"20",@"property":@"6",@"page":@"1"};
    
    
    [self.navigationController pushViewController:packageView animated:YES];
    
}

- (void)button_2_action{
    NSLog(@"Button Press Tag 2!!");
    PackageViewController *packageView = [[PackageViewController alloc] init];
    
    packageView.packageStr = @"http://hunliji.com/v2/api/app/works";
    packageView.packageDic = @{@"page": @"1",@"per_page":@"20", @"commodity_type":@"0", @"first_query_time":@"2015-06-25T08%3A43%3A51Z", @"property":@"7",@"sort[key]":@"default",@"sort[order]":@"desc"};
    
    packageView.caseStr = @"http://hunliji.com/v2/api/app/works";
    packageView.caseDic = @{@"page": @"1",@"per_page":@"20", @"commodity_type":@"1", @"first_query_time":@"2015-06-25T11%3A13%3A18Z", @"property":@"7",@"sort[key]":@"default",@"sort[order]":@"desc"};
    
    packageView.merchantStr = @"http://hunliji.com/v1/api/app/merchants.json";
    packageView.merchantDic = @{@"page":@"1",@"per_page":@"20",@"property":@"7"};
    
    
    
    [self.navigationController pushViewController:packageView animated:YES];
}

- (void)button_3_action{
    NSLog(@"Button Press Tag 3!!");
    PackageViewController *packageView = [[PackageViewController alloc] init];
    
    packageView.packageStr = @"http://hunliji.com/v2/api/app/works";
    packageView.packageDic = @{@"page": @"1",@"per_page":@"20", @"commodity_type":@"0", @"first_query_time":@"2015-06-25T11%3A16%3A39Z", @"property":@"8",@"sort%5Bkey%5D":@"default",@"sort%5Border%5D":@"desc"};
    
    packageView.caseStr = @"http://hunliji.com/v2/api/app/works";
    packageView.caseDic = @{@"page": @"1",@"per_page":@"20", @"commodity_type":@"1", @"first_query_time":@"2015-06-25T11%3A16%3A39Z", @"property":@"8",@"sort%5Bkey%5D":@"default",@"sort%5Border%5D":@"desc"};
    
    packageView.merchantStr = @"http://hunliji.com/v1/api/app/merchants.json";
    packageView.merchantDic = @{@"page":@"1",@"per_page":@"20",@"property":@"8"};
    
    [self.navigationController pushViewController:packageView animated:YES];
}

- (void)button_4_action{
    NSLog(@"Button Press Tag 4!!");
    PackageViewController *packageView = [[PackageViewController alloc] init];
    
    packageView.packageStr = @"http://hunliji.com/v2/api/app/works";
    packageView.packageDic = @{@"page": @"1",@"per_page":@"20", @"commodity_type":@"0", @"first_query_time":@"2015-06-25T11%3A23%3A27Z", @"property":@"9",@"sort%5Bkey%5D":@"default",@"sort%5Border%5D":@"desc"};
    
    packageView.caseStr = @"http://hunliji.com/v2/api/app/works";
    packageView.caseDic = @{@"page": @"1",@"per_page":@"20", @"commodity_type":@"1", @"first_query_time":@"2015-06-25T11%3A23%3A27Z", @"property":@"9",@"sort%5Bkey%5D":@"default",@"sort%5Border%5D":@"desc"};
    
    packageView.merchantStr = @"http://hunliji.com/v1/api/app/merchants.json";
    packageView.merchantDic = @{@"page":@"1",@"per_page":@"20",@"property":@"9"};
    
    
    
    
    [self.navigationController pushViewController:packageView animated:YES];
}

- (void)button_5_action{
    NSLog(@"Button Press Tag 5!!");
    PackageViewController *packageView = [[PackageViewController alloc] init];
    
    packageView.packageStr = @"http://hunliji.com/v2/api/app/works";
    packageView.packageDic = @{@"page": @"1",@"per_page":@"20", @"commodity_type":@"0", @"first_query_time":@"2015-06-25T11%3A33%3A07Z", @"property":@"11",@"sort%5Bkey%5D":@"default",@"sort%5Border%5D":@"desc"};
    
    packageView.caseStr = @"http://hunliji.com/v2/api/app/works";
    packageView.caseDic = @{@"page": @"1",@"per_page":@"20",@"city":@"1", @"commodity_type":@"1", @"first_query_time":@"2015-06-25T11%3A44%3A34Z", @"property":@"11",@"sort%5Bkey%5D":@"default",@"sort%5Border%5D":@"desc"};
    
    packageView.merchantStr = @"http://hunliji.com/v1/api/app/merchants.json";
    packageView.merchantDic = @{@"city":@"1",@"page":@"1",@"per_page":@"20",@"property":@"11"};
    

    [self.navigationController pushViewController:packageView animated:YES];
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    [[SDImageCache sharedImageCache] clearMemory];
    // Dispose of any resources that can be recreated.
    

}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
